package com.lghs.vickual_pf;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Spinner;
import android.widget.AdapterView.OnItemSelectedListener;

public class Activity_Physical extends Activity {

	Spinner charactertype;
	static int BonusSTR, BonusDEX, BonusCON, BonusINT, BonusWIS, BonusCHA;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.physical);
		setUpView();
		listeners();
	}

	public void setUpView() /*
							 * No need to touch this again unless more views are
							 * needed.
							 */
	{
		charactertype = (Spinner) findViewById(R.id.physical_spinner_charactertype);
	}

	public void listeners()
	{
		charactertype.setOnItemSelectedListener(new OnItemSelectedListener() {
			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				BonusSTR = 0;
				BonusDEX = 0;
				BonusCON = 0;
				BonusINT = 0;
				BonusWIS = 0;
				BonusCHA = 0;
				/*Dwarf*/
				if (charactertype.getSelectedItemPosition() == 1) {
					BonusCON = 2;
					BonusWIS = 2;
					BonusCHA = -2;
				}
				/*Elf*/
				if (charactertype.getSelectedItemPosition() == 2) {
					BonusDEX = 2;
					BonusINT = 2;
					BonusCON = -2;
				}
				/*Gnome*/
				if (charactertype.getSelectedItemPosition() == 3) {
					BonusCON = 2;
					BonusCHA = 2;
					BonusSTR = -2;
				}
				/*Half Elf*/
				if (charactertype.getSelectedItemPosition() == 4) {
					/*Decision making here.*/
				}
				/*Halfling*/
				if (charactertype.getSelectedItemPosition() == 5) {
					BonusDEX = 2;
					BonusCHA = 2;
					BonusSTR = -2;
				}
				/*Half Orc*/
				if (charactertype.getSelectedItemPosition() == 6) {
					/*Decision making here.*/
				}
				/*Human*/
				if (charactertype.getSelectedItemPosition() == 7) {
					/*Decision making here.*/
				}
				/*Intent Code here*/
				if (charactertype.getSelectedItemPosition() > 0) {
					Intent i = new Intent();
					 i.setClass(getApplicationContext(), Activity_Stats.class);
					 i.putExtra("BonusSTR",BonusSTR);
					 i.putExtra("BonusDEX",BonusDEX);
					 i.putExtra("BonusCON",BonusCON);
					 i.putExtra("BonusINT",BonusINT);
					 i.putExtra("BonusWIS",BonusWIS);
					 i.putExtra("BonusCHA",BonusCHA);
					 startActivity(i);
				}
			}

			public void onNothingSelected(AdapterView<?> parentView) {
			}
		});
	}
}
